package com.xbao.service.impl;

import com.xbao.dao.GuideDocMapper;
import com.xbao.model.GuideDoc;
import com.xbao.model.GuideDocExample;
import com.xbao.service.GuideDocService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class GuideServiceImpl implements GuideDocService {

    @Autowired
    private GuideDocMapper mapper;



    @Override
    public void addGuideDoc(GuideDoc doc) {
        mapper.insert(doc);

    }

    @Override
    public void updateGuideDoc(GuideDoc doc) {
        mapper.updateByPrimaryKeySelective(doc);


    }

    @Override
    public void deleteGuideDoc(Long id) {
        mapper.deleteByPrimaryKey(id);

    }

    @Override
    public List<GuideDoc> listGuideDocs(GuideDoc doc) {
        GuideDocExample example=new GuideDocExample();
       List<GuideDoc> docs= mapper.selectByExample(example);

        return docs;
    }
}
